package com.freemyleft.left.left_app.mian.index.my.mywallet.share;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.freemyleft.left.left_app.R;
import com.freemyleft.left.left_app.R2;
import com.freemyleft.left.left_app.mian.index.work.adapter.WorkPageAdapter;
import com.freemyleft.left.zapp.delegates.LeftDelegate;

import java.util.ArrayList;

import butterknife.BindView;

public class SharedListDelegate extends LeftDelegate {
    @BindView(R2.id.work_tablayout)
    TabLayout tabLayout;
    @BindView(R2.id.work_viewpager)
    ViewPager mPager;
    WorkPageAdapter adapter;
    private ArrayList<LeftDelegate> DELEGEDE = new ArrayList<>();

    private ArrayList<String> mTitle = new ArrayList<>();

    @Override
    public Object setLayout() {
        return R.layout.delegate_shared_list;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, @NonNull View rootView) {
        mTitle.add("直接共享（20人）");
        mTitle.add("间接共享（20人）");
        DELEGEDE.add(new DirectShareDelegate());
        DELEGEDE.add(new IndirectShareDelegate());
        adapter = new WorkPageAdapter(getChildFragmentManager(), mTitle, DELEGEDE);
        tabLayout.setTabMode(TabLayout.MODE_FIXED);
        mPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(mPager);

    }
}
